<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div style="width:400px; margin: 0 auto;">
    <h1>管理员登录</h1>
    <div>
        <div>
            账号：<input type="text" id="account"/>
        </div>
        <div>
            密码：<input type="password" id="pwd"/>
        </div>
        <input type="button" value="登录" onclick="doLogin()">
    </div>
</div>
</body>
<script type="text/javascript" src="/zepto.min.js"></script>
<script type="text/javascript">
    function doLogin() {
        var account = $("#account").val();
        if (!account) {
            alert("请输入账号");
            return;
        }
        var pwd = $("#pwd").val();
        if (!pwd) {
            alert("请输入密码");
            return;
        }
        $.post("/login/manager", {
            account: account,
            pwd: pwd
        }, function (res) {
            if (res.success) {
                alert("登录成功");
            } else {
                alert(res.message);
            }
        });
    }
</script>
</html>